<div class="container">
    <?php
    $profile = $member->profile();
    $option=intval($_GET['option'])?intval($_GET['option']):1;
    ?>
    <?php include 'member-left.php'; ?>

    <div class="member_c">

        <div class="title_mb_bg2 member_info_edit">
            <div class="linkmain">
                <ul class="tab_product">
                    <li id="optionLi1" <?php echo $option == 1 ? 'class="active"' : ''; ?>><a href="javascript:;" onclick="viewEditOption(1);">Thông tin cơ bản</a></li>
                    <li id="optionLi2" <?php echo $option == 2 ? 'class="active"' : ''; ?>><a href="javascript:;" onclick="viewEditOption(2);">Học vấn & Nghề nghiệp</a></li>
                    <li id="optionLi3" <?php echo $option == 3 ? 'class="active"' : ''; ?>><a href="javascript:;" onclick="viewEditOption(3);">Sở thích</a></li>
                    <li id="optionLi4" <?php echo $option == 4 ? 'class="active"' : ''; ?>><a href="javascript:;" onclick="viewEditOption(4);">Ảnh đại diện</a></li>
                </ul>
            </div>
            <div id="message_alert" style="padding: 10px; margin-top: 30px;display: none;">
                <div id="message_alert_content"></div>
            </div>
            <ul id="option1" <?php echo $option != 1 ? 'style="display:none;"' : ''; ?>>
                <li>
                    <div class="col_l">Bí danh(hiển thị)</div>
                    <div class="col_r">
                        <input type="text"  id="nickname" class="w255" value="<?php echo $profile['profile']['nickname']; ?>"  />
                    </div>
                </li>
                <li>
                    <div class="col_l">Họ tên</div>
                    <div class="col_r"><input name="first_name" style="width: 138px;text-align: center" type="text" id="first_name" value="<?php echo $profile['profile']['first_name']?$profile['profile']['first_name']:'---Họ & Tên đệm---'; ?>" onblur="if(this.value=='' || this.value==' '){this.value='---Họ & Tên đệm---'}" onclick="if(this.value=='---Họ & Tên đệm---'){this.value=''}" /><input name="last_name" class="w100" style="margin-left: 5px;;text-align: center" type="text" id="last_name" value="<?php echo $profile['profile']['last_name']?$profile['profile']['last_name']:'---Tên---'; ?>" onblur="if(this.value=='' || this.value==' '){this.value='---Tên---'}" onclick="if(this.value=='---Tên---'){this.value=''}" /></div>
                </li>
                <li>
                    <div class="col_l">Giới tính</div>
                    <div class="col_r">
                        <select id="gender" >
                            <option value="0">Chưa xác định...</option>
                            <option <?php echo $profile['profile']['gender'] == 1 ? 'selected' : ''; ?> value="1">Nam</option>
                            <option <?php echo $profile['profile']['gender'] == 2 ? 'selected' : ''; ?> value="2">Nữ</option>
                        </select>
                    </div>
                </li>
                <li>
                    <div class="col_l">Sinh nhật</div>
                    <div class="col_r"><input type="text" id="dob"  value="<?php echo $profile['profile']['dob'] != '0000-00-00' ? $common->dateFormatVI($profile['profile']['dob'],"-") : ''; ?>"  /></div>
                </li>
                <li>
                    <div class="col_l">Tình trạng hôn nhân</div>
                    <div class="col_r">
                        <select id="is_married" name="district" >
                            <option value="0">Độc thân...</option>
                            <option <?php echo $profile['profile']['is_married'] == 1 ? 'selected' : ''; ?> value="1">Đã kết hôn</option>
                        </select>
                    </div>
                </li>
                <li>
                    <div class="col_l">Nơi ở hiện tại</div>
                    <div class="col_r"><input type="text" id="current_address" value="<?php echo $profile['profile']['current_address']; ?>"  /></div>
                </li>

                <li>
                    <div class="col_l">Quê quán</div>
                    <div class="col_r">
                        <?php
                        $city = $geo->getCity();
                        ?>
                        <select id="city" >
                            <option value="0">Chọn tỉnh/tp của bạn...</option>
                            <?php
                            while ($row = $db->fetch_array($city)) {
                                if ($row['id'] == $profile['profile']['city_id']) {
                                    echo '<option selected="selected" value="' . $row['id'] . '">' . $row['name'] . '</option>';
                                } else {
                                    echo '<option value="' . $row['id'] . '">' . $row['name'] . '</option>';
                                }
                            }
                            ?>
                        </select>
                    </div>
                </li>
                <li>
                    <div class="col_l">&nbsp;</div>
                    <div class="col_r">
                        <select id="district" >
                            <option value="0">Chọn quận/huyện của bạn...</option>
                            <?php
                            while ($row = $db->fetch_array($profile['rsDistricts'])) {
                                if ($row['id'] == $profile['profile']['geo_id']) {
                                    echo '<option selected="selected" value="' . $row['id'] . '">' . $row['name'] . '</option>';
                                } else {
                                    echo '<option value="' . $row['id'] . '">' . $row['name'] . '</option>';
                                }
                            }
                            ?>
                        </select>
                    </div>
                </li>
                <li>
                    <div class="col_l">&nbsp;</div>
                    <div class="col_r"><input type="text" id="hometown" value="<?php echo $profile['profile']['hometown']; ?>"  /></div>
                </li>
                <li>
                    <div class="col_l">Tự giới thiệu</div>
                    <div class="col_r">
                        <textarea id="about" rows="4" cols="40"><?php echo $profile['profile']['about']; ?></textarea>
                    </div>
                </li>

                <!--
                <li>
                    <div class="col_l">Bản đồ</div>
                    <div class="col_r">
                        <a href="javascript:;" onclick="createMapWindow();">Ẩn/Hiện bản đồ</a>
                    </div>
                    <div id="anHienBanDo">

                        <div style="margin: 5px 0;">
                            Tìm địa danh: <input type="text"  id="txtSearchMap" onkeydown="if (event.keyCode == 13){getByAddress($(this).val())}" value="" style="width:250px;" />
                            <span>Hãy tìm vị trí chính xác nhà bạn từ vệ tinh!</span>
                            <br/>
                            <input type="button" value="Lưu vị trí" class="btnBlogComment" id="saveMap" onclick="setMapProfile();" style="border:0; color:#FFF;float: right;"/>
                            <span id="displayAddress"></span>
                        </div>

                        <input type="hidden" id="mapLatLonTemp" name="map" value="0"/>
                        <input type="hidden" id="mapLatLon" name="map" value="0"/>
                        <div id="mapDisplayArea" style="width:100%; height:500px;float:left;"></div>
                    </div>

                </li>
                -->

                <li class="end">
                    <div class="col_l">&nbsp;</div>
                    <div class="col_r"><input type="button" lang="1" value="Lưu thay đổi" style=" float:left; color:#FFF;" class="btnBlogComment" /><span class="link">hoặc  <a href="javascript:;" onclick="history.go(-1);">Hủy</a></span></div>
                </li>
            </ul>
            <ul id="option2" <?php echo $option != 2 ? 'style="display:none;"' : ''; ?>>
                <li>
                    <div class="col_l">Trường cấp III</div>
                    <div class="col_r"><input type="text" id="high_school" value="<?php echo $profile['profile']['high_school']; ?>"  /></div>
                </li>
                <li>
                    <div class="col_l">Đại học/Cao đẳng</div>
                    <div class="col_r"><input type="text" id="university" value="<?php echo $profile['profile']['university']; ?>"  /></div>
                </li>
                <li>
                    <div class="col_l">Nghề nghiệp</div>
                    <div class="col_r"><input type="text" id="job" value="<?php echo $profile['profile']['job']; ?>"  /></div>
                </li>

                <li class="end">
                    <div class="col_l">&nbsp;</div>
                    <div class="col_r"><input type="button"  lang="2" value="Lưu thay đổi" style=" float:left; color:#FFF;" class="btnBlogComment" /><span class="link">hoặc  <a href="javascript:;" onclick="history.go(-1);">Hủy</a></span></div>
                </li>
            </ul>
            <ul id="option3" <?php echo $option != 3 ? 'style="display:none;"' : ''; ?>>
                <li>
                    <div class="col_l">Âm nhạc</div>
                    <div class="col_r"><input type="text" id="music" value="<?php echo $profile['profile']['music']; ?>"  /></div>
                </li>
                <li>
                    <div class="col_l">Phim ảnh</div>
                    <div class="col_r"><input type="text" id="movie" value="<?php echo $profile['profile']['movie']; ?>"  /></div>
                </li>
                <li>
                    <div class="col_l">Thể thao</div>
                    <div class="col_r"><input type="text" id="sport" value="<?php echo $profile['profile']['sport']; ?>"  /></div>
                </li>
                <li>
                    <div class="col_l">Đọc sách</div>
                    <div class="col_r"><input type="text" id="book" value="<?php echo $profile['profile']['book']; ?>"  /></div>
                </li>
                <li>
                    <div class="col_l">Sở thích khác</div>
                    <div class="col_r"><input type="text" id="other_hobby" value="<?php echo $profile['profile']['other_hobby']; ?>"  /></div>
                </li>

                <li class="end">
                    <div class="col_l">&nbsp;</div>
                    <div class="col_r"><input type="button" lang="3" value="Lưu thay đổi" style=" float:left; color:#FFF;" class="btnBlogComment" /><span class="link">hoặc  <a href="javascript:;" onclick="history.go(-1);">Hủy</a></span></div>
                </li>
            </ul>
            
            <ul id="option4" <?php echo $option != 4 ? 'style="display:none;"' : ''; ?>>
                <li>
                    <div>
                         <span class="avatar" id="spanAvatar">
                            <img id="avatar" src="<?php echo $profile['profile']['avatar']; ?>" width="180" />
                        </span>
                        <span style="float: left;margin-left: 20px;">
                            <input type="hidden" id="mid" value="<?php echo $_SESSION['client']['id']; ?>"/>
                            <input type="file" id="avatarUpload" /><br>
                            <p class="explain">Vui lòng chọn ảnh định dạng *.jpg, <br>*.jpeg, *.gif hoặc *.png (tối đa 5 MB).</p>
                            <p style="margin-top: 10px;padding-left:5px"><a title="Chỉnh sửa ảnh đại diện" style="" id="editavatar" href="javascript:createAvatarWindow('<?php echo $_GET['mid']; ?>');">Chỉnh sửa ảnh</a></p>
                        </span>
                    </div>
                </li>
              
            </ul>
        </div>
    </div>
</div>
<script src="/js/profile.js" type="text/javascript"></script>
<script src="/js/avatar.js" type="text/javascript"></script>